<template>
  <scroll-view
    :scroll-x="scroll.x"
    :scroll-y="scroll.y"
    class="scroll-container"
    :class="className"
  >
    <van-cell-group>
      <column
        format="default"
        :title="item.title"
        :description="item.description"
        :medias="item.medias"
        v-for="(item,index) in items"
        :key="index"
      />
    </van-cell-group>
  </scroll-view>
</template>

<script>
import Column from '@/components/column/index'
import ScaleImage from '@/components/scaleImage'
import DoubleFence from '@/components/doubleFence'
import GroupCell from '@/components/groupCell'
export default {
  components: {
    Column,
    ScaleImage,
    DoubleFence,
    GroupCell
  },
  props: {
    url: {
      type: String,
      default: ''
    },
    className: {
      type: String,
      default: ''
    },
    scroll: {
      type: Object,
      default: {
        x: false,
        y: true
      }
    }
  },
  data () {
    return {
      items: [
        {
          id: 1,
          title: '12年前发明“熊猫烧香”病毒的网络天才，坐4年牢后，现状如何？',
          description: '微观影视 1小时前 102评论',
          format: 'default',
          medias: [
            {
              path: 'http://oss.youmbe.com/attachments/temp/01.jpg',
              format: 'image'
            }
          ]
        },
        {
          id: 2,
          title: '济南东部房价“喋喋不休”，西部房价依然坚挺，为何？',
          description: '济南楼市 1小时前 102评论',
          format: 'default',
          medias: [
            {
              path: 'http://oss.youmbe.com/attachments/temp/02.jpg',
              format: 'image'
            }
          ]
        },
        {
          id: 3,
          title: '心寒！市民主动清理黑衣人设置的路障 被暴徒用重器猛击头部',
          description: '环球网国内 7小时前 21评论',
          format: 'default',
          medias: []
        },
        {
          id: 4,
          title: '32核心64线程 AMD锐龙Threadripper 3970X评测',
          description: '中关村在线 12-01 05:27 21评论',
          format: 'default',
          medias: [
            {
              path: 'http://oss.youmbe.com/attachments/temp/03.jpg',
              format: 'image'
            }
          ]
        },
        {
          id: 6,
          title: '32核心64线程 AMD锐龙Threadripper 3970X评测',
          description: '中关村在线 12-01 05:27 21评论',
          format: 'default',
          medias: [
            {
              path: 'http://oss.youmbe.com/attachments/temp/04.jpg',
              format: 'image'
            }
          ]
        },
        {
          id: 5,
          title: '国庆七十周年阅兵 显国威、振军威',
          description: '凤凰网 10-01 10:27 12,321评论',
          format: 'default',
          medias: [
            {
              path: 'http://oss.youmbe.com/attachments/temp/11.jpg',
              format: 'image'
            }
          ]
        },
        {
          id: 16,
          title: '32核心64线程 AMD锐龙Threadripper 3970X评测',
          description: '中关村在线 12-01 05:27 21评论',
          format: 'default',
          medias: [
            {
              path: 'http://oss.youmbe.com/attachments/temp/04.jpg',
              format: 'image'
            }
          ]
        },
        {
          id: 15,
          title: '国庆七十周年阅兵 显国威、振军威',
          description: '凤凰网 10-01 10:27 12,321评论',
          format: 'default',
          medias: [
            {
              path: 'http://oss.youmbe.com/attachments/temp/11.jpg',
              format: 'image'
            }
          ]
        }
      ]
    }
  },
  watch: {},
  computed: {},
  beforeMount () {},
  mounted () {},
  methods: {}
}
</script>

<style lang="less">
.scroll-container {
  height: 100%;
}

.horizontal-scroll-container {
  white-space: nowrap;
  height: 90px;
  overflow-y: hidden;
  margin-bottom: 10px;
}

.topic-item {
  position: relative;
  display: inline-block;
  border-radius: 5px;
  margin-left: 15px;
  overflow: hidden;

  &:last-child {
    margin-right: 15px;
  }
  &::after,
  image {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
  }
  &::after {
    content: '';
    background: rgba(0, 0, 0, 0.8);
  }
  &-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    width: 160px;
    height: 90px;
    padding: 10px;
    box-sizing: border-box;
  }
  &__title {
    font-size: 14px;
    width: 100%;
    word-wrap: break-word;
    word-break: break-all;
    white-space: pre-line;
  }
  &__extend {
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    .van-tag {
      border-bottom-left-radius: 0;
    }
  }
}

.yuntuan {
  display: flex;
  padding: 15px 15px 0;
  &-group {
    flex: 2;
    .van-cell {
      padding-left: 5px;
    }
    .van-icon--image {
      width: 24px;
      height: 24px;
      border-radius: 3px;
      overflow: hidden;
    }
  }
  &-box {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-direction: column;
    padding: 0 0 10px;
  }
  &-catename {
    display: flex;
    align-items: center;
    font-size: 16px;
    margin: 0 0 10px;
    font-weight: 600;
    small {
      margin-left: 10px;
      font-size: 12px;
      color: #dcdcdc;
      font-weight: normal;
    }
  }
  &-avatars {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    flex-direction: row-reverse;
    padding-right: 7px;
    span {
      display: inline-block;
      width: 15px;
      image {
        width: 20px;
        height: 20px;
        border-radius: 50%;
        box-shadow: 2px 2px 2px 2px rgba(85, 85, 85, 0.1);
      }
    }
  }
  &-mark {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.5);
  }
}

.shop-recommend {
  padding: 0 15px;
}
.item-ans {
  width: 100%;
  display: flex;
  flex-grow: row no-wrap;
  justify-content: space-between;
  padding: 30rpx;
  box-sizing: border-box;
  height: 180rpx;
  align-items: center;
  border-bottom: 1px solid #f2f2f2;
}
.avatar {
  width: 100rpx;
  height: 100rpx;
  position: relative;
  padding-right: 30rpx;
}
.avatar .img {
  width: 100%;
  height: 100%;
}
.avatar .doyen {
  width: 40rpx;
  height: 40rpx;
  position: absolute;
  bottom: -2px;
  right: 20rpx;
}
.expertInfo {
  font-size: 12px;
  flex-grow: 2;
  color: #b0b0b0;
  line-height: 1.5em;
}
.expertInfo .name {
  font-size: 16px;
  color: #000;
  margin-bottom: 6px;
}
.askBtn {
  width: 120rpx;
  height: 60rpx;
  line-height: 60rpx;
  text-align: center;
  font-size: 14px;
  border-radius: 60rpx;
  border: 1px solid #4675f9;
  color: #4675f9;
}
</style>
